//priority 49
/**
 * 等级类实现了怪物的等级的函数
*/
const max_health_uuid = "2c16a7cf-2a94-47af-b676-f3acc67e3dcf"
function LevelEntry(name) {
    BaseEntry.call(this, name)
}
// 建立原型链
LevelEntry.prototype = Object.create(BaseEntry.prototype);
LevelEntry.prototype.constructor = LevelEntry;

//怪物加载词条的时候初始化调用
LevelEntry.prototype.apply = function (nbt, monster, level) {
    if (monster instanceof $LivingEntity) {
        monster.attributes.getInstance("minecraft:generic.max_health").addTransientModifier(new $AttributeModifier(max_health_uuid, "Level_health", 2 * level, "addition"))
        monster.heal(2000000)
    }
}

var a = new LevelEntry("level").init()
//注册技能自身
global.EntryHelper.RegisterEntry(a).AddToEntryGroup(a, "level_group")